﻿
namespace System
{
    /// <summary>
    /// A generic service provider
    /// </summary>
    public static class GenericServiceProvider
    {
        /// <summary>
        /// Expose GetService generic to method group
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="serviceProvider"></param>
        /// <returns></returns>
        [System.Diagnostics.DebuggerNonUserCode]
        public static T GetService<T>(this IServiceProvider serviceProvider)
        {
            return (T)serviceProvider.GetService(typeof(T));
        }
    }
}
